import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { AnnexButton } from '../Common/options'

const { hostname } = window.location

const independenceList = {
    'jtgjadmin.ljkjkf.com': 'organizationUuid',
    'jtgjadmin.hljsjtgj.com': 'organizationUuid',
}

export const ListHtshContract = async ({ url, OptionsEvent, ClientData, Permission, actionRef }) => {
    let data = {
        pageSize: 10,
        params: { pageIndex: 1 },
        get: API_LIST()[`get${url}`],
        added: `pos${url}`,
        modify: `put${url}`,
        delete: `del${url}`,
        hideInSearch: true,
        independenceSet: {
            title: '组织机构',
            url: 'getOrgTree',
            data: { IsByUserUuid: 1 },
            type: 'TableNavTree001',
            all: true,
        },
        independence: independenceList[hostname],
        hideInSearch: true,
        options: [
            <AnnexButton
                OptionsEvent={OptionsEvent}
                key="thr"
                url="https://image.ljkjkf.com/intellisiteSystem_TieKe/jtgj/2.png"
                title="风险审核"
                type="primary"
                icon="a01"
            />,
            <AnnexButton
                OptionsEvent={OptionsEvent}
                key="thr"
                url="123.png"
                title="版本比对"
                type="primary"
                icon="a02"
                readonly={true}
            />,
            <AnnexButton
                OptionsEvent={OptionsEvent}
                key="thr"
                url="123.png"
                title="信息提取"
                type="primary"
                icon="a03"
                readonly={true}
            />,
            <AnnexButton
                OptionsEvent={OptionsEvent}
                key="thr"
                url="https://image.ljkjkf.com/intellisiteSystem_TieKe/jtgj/1.png"
                title="智能比对"
                type="primary"
                icon="a02"
            />,
            <AnnexButton
                OptionsEvent={OptionsEvent}
                key="thr"
                url="123.png"
                title="要素比对"
                type="primary"
                icon="a02"
                readonly={true}
            />,
        ],
        columns: [
            commonTableList.uuid,
            {
                dataIndex: 'bh',
                title: '编号',
                valueType: 'input',
                width: 80,
            },
            {
                dataIndex: 'wjmc',
                title: '文件名称',
                valueType: 'input',
                width: 120,
            },
            {
                dataIndex: 'czlx',
                title: '操作类型',
                valueType: 'input',
                width: 80,
            },
            {
                dataIndex: 'zt',
                title: '状态',
                valueType: 'input',
                width: 80,
            },
            {
                dataIndex: 'czry',
                title: '操作人员',
                valueType: 'input',
                width: 80,
            },
            {
                dataIndex: 'updatetime',
                title: '更新时间',
                valueType: 'input',
                width: 120,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 80,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <AnnexButton
                            OptionsEvent={OptionsEvent}
                            key="thr"
                            url="https://image.ljkjkf.com/intellisiteSystem_TieKe/jtgj/2.png"
                            title="查看风险"
                        />,
                    ]
                },
            },
        ],
    }

    return data
}
